package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.zr.model.Cp_xxd;
import com.zr.service.InsertService;
import com.zr.service.ShowService;
import com.zr.serviceimp.InsertServiceImpl;
import com.zr.serviceimp.ShowServiceImpl;

public class InsertcpController extends HttpServlet{
	ShowService ss = new ShowServiceImpl();
	InsertService is = new InsertServiceImpl();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
				// TODO Auto-generated method stub
				doPost(req, resp);
			}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
				// TODO Auto-generated method stub
				
				//int did = Integer.parseInt(req.getParameter("did"));
				String dname = req.getParameter("dname");
				int dnumber = Integer.parseInt(req.getParameter("dnum"));
				String sname = req.getParameter("sname");
				int rid = Integer.parseInt(req.getParameter("rid"));
				int rprice = Integer.parseInt(req.getParameter("rprice"));
				int isopen = Integer.parseInt(req.getParameter("isopen"));
				Cp_xxd cp= is.inInsertCp(dname, dnumber, sname, rid, rprice, isopen);
				
			}
}
